﻿namespace BM.Tools.WebControls.MForm.Controls.Additions
{
    using System.Web.UI;

    /// <summary>
    /// A control that is a definition for a value of a different item that is part of the description
    /// </summary>
    public class ValueDescription : DescriptionChunk
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ValueDescription"/> class. 
        /// </summary>
        public ValueDescription()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ValueDescription"/> class. 
        /// </summary>
        /// <param name="path">
        /// The path to the item.
        /// </param>
        public ValueDescription(string path)
        {
            Path = path;
        }

        /// <summary>
        /// Gets or sets Path.
        /// </summary>
        /// <value>
        /// The path to the item.
        /// </value>
        public string Path
        {
            get;
            set;
        }

        /// <summary>
        /// Adds path attribute to render.
        /// </summary>
        /// <param name="writer">
        /// The writer.
        /// </param>
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            writer.AddAttribute("path", Path);
        }
    }
}